package com.ltmonitor.service.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ltmonitor.dao.IAlarmConfigDao;
import com.ltmonitor.dao.IFunctionModelDao;
import com.ltmonitor.entity.FunctionModel;
import com.ltmonitor.service.IFunctionModelService;
/**
 * 报警配置服务
 * @author admin
 *
 */

@Service("FunctionModelService")
@Transactional(propagation = Propagation.REQUIRED) 
public class FunctionModelService extends BaseService<Long, FunctionModel> implements IFunctionModelService {
	@Autowired
	private IFunctionModelDao functionModelDao;
	
	public List<FunctionModel>  queryFunctionModelList(long parentId, int funcType)
	{
		String hsql = "from FunctionModel where parentId = ? and funcType = ? and deleted = ? order by menuSort";
		List<FunctionModel> subSysFuncs = this.query(hsql,
				new Object[] { parentId, funcType, false });
		return subSysFuncs;
	}
	
	@Override
	public Collection<FunctionModel> loadAll()
	{
		String hsql = "from FunctionModel where  deleted = ? order by menuSort";
		List<FunctionModel> result = this.query(hsql,
				false);
		return result;
	}
}
